Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'rewriterule'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 2 results

  1. Hello Larry, Thank you for the publishing of your book. We are using it at school to learn development of an e-commerce site. I wanted to share with you an issue me and some of my classmates have run into in chapter 7. I am testing the ex2 site locally with the following specs: PHP 7.1.33 MySQL 5.7.28 using Local.app by flywheel to run local Apache server Using PHPStorm to run and debug my code. It seems like my .htaccess rules are not working, but I am not sure why the rules are not redirecting correct, Kind of having a hard time understanding if it's the htaccess file or my headers.html, or home.html files? I attached a zipped file of my configurations. The code in my htaccess file is just like the Ex2 2016 code download, except I have subdirectories "/homework/ex2/html/" as the rewriteBase value (2nd edition book, page 201, Using Subdirectories). We were asked to place our site files into a subdirectory. I'll attach my htaccess file, headers.html, and home.html in a separate zip file (Files-modified-ex2site.zip). The main issues is that my secondary links to the site sections are producing broken images. I explain this in more detail in the Chapter 7 bugs zip file. I have tried multiple relative and absolute path edits, but the current set up is the best I could figure out to access most of the files on my local test browser. Any help is appreciated. Chapter 7 Bugs to fix.zip Files-modified-ex2site.zip Chapter 7 Bugs to fix.zip
  2. Hi, My htaccess has a this ReWriteRule which works perfectly: RewriteRule ^browse/([A-Za-z\+\-]+)/([A-Za-z\+\-]+)/?$ browse.php?type=$1&category=$2 However sometimes I see the variables included in the URL bar. Eg: https://www.mysite.com/browse/on-road/lights?type=on-road&category=lights Other links are fine: https://www.mysite.com/browse/on-road/worklights I cant tell why only a few select links show the variables. Any help would be appreciated. Here is my full htaccess file - some bits added for SEO: <if "%{HTTPS} == 'on'"> Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" </if> ErrorDocument 404 /404.php <IfModule mod_rewrite.c> Options -MultiViews ## Base Redirects ## # Turn on Rewrite Engine RewriteEngine On # Redirect to secure HTTPS before changing host RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC] RewriteCond %{https} off RewriteRule ^(.*)$ https://mysite.com/$1 [R=301,L] # Remove trailing slash from non-filepath urls RewriteCond %{REQUEST_URI} /(.+)/$ RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ https://www.mysite.com/%1 [R=301,L] # Include trailing slash on directory RewriteCond %{REQUEST_URI} !(.+)/$ RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+)$ https://www.mysite.com/$1/ [R=301,L] # Force HTTPS and WWW RewriteCond %{HTTP_HOST} !^www\.(.*)$ [OR,NC] RewriteCond %{https} off RewriteRule ^(.*)$ https://www.mysite.com/$1 [R=301,L] # For product categories: RewriteRule ^browse/([A-Za-z\+\-]+)/([A-Za-z\+\-]+)/?$ browse.php?type=$1&category=$2 # For specific product: RewriteRule ^products/([A-Za-z\+\-]+)/([0-9a-zA-Z-]+)/?$ products.php?category=$1&SEOpagename=$2 </IfModule
×
×
  • Create New...