Jump to content
Larry Ullman's Book Forums

Htaccess Version 2 In Ex2 Dont Work?


Recommended Posts

 

Hello,

I bought the new book version 2.0.

I am now using the ex2 software testing.

But the menus do not appear via htaccess.

My htaccess is:

<IfModule mod_rewrite.c>

Options-MultiViews

RewriteEngine on

# For the primary categories:

RewriteRule ^ shop / (coffee | goodies)? / Shop.php $ type = $ 1?

 

# For sales:

RewriteRule ^ shop / sales /? $ / Sales.php

# For specific products:

RewriteRule ^ browse / (coffee | goodies) / ([A-Za-z \ + \ -] +) / ([0-9] +) / $ browse.php type = $ 1 & category = $ 2 & id = $ 3?

[edit]

Yes Fixed.

I have to change the menu in header html in

shopon/shop/sales and it works

[/edit]

# For HTTPS pages:

RewriteCond% {HTTPS} off

RewriteRule ^ (\ checkout php |. Billing \ php |. Final \ php |. Admin / (*).) $ Https://% {HTTP_HOST} / $ 1 [R = 301, L]

 

</ IfModule>

Even with my ISP does not work.

I work at home with xampp in localhost and the ISP in a sub folder test.

Folder in localhost htdocs / shopon

Anyone have an idea?

Thanks and regards.

Edited by Descartes
Link to comment
Share on other sites

Hello and welcome to the forums.

 

mod_rewrite is a tricky thing that causes a lot of people problems.

For testing purposes, start of with something very simple (e.g., RewriteRule a.html b.html), and make sure that works.

If it does, then you know the problem is with your regexes.

If it doesn't, then you know the problem is with your setup/configuration.

Link to comment
Share on other sites

  • 2 years later...

Hello,

I bought the new book version 2.0.

I am now using the ex2 software testing.

But the menus do not appear via htaccess.

My htaccess is:

<IfModule mod_rewrite.c>

Options-MultiViews

RewriteEngine on

# For the primary categories:

RewriteRule ^ shop / (coffee | goodies)? / Shop.php $ type = $ 1?

 

# For sales:

RewriteRule ^ shop / sales /? $ / Sales.php

# For specific products:

RewriteRule ^ browse / (coffee | goodies) / ([A-Za-z \ + \ -] +) / ([0-9] +) / $ browse.php type = $ 1 & category = $ 2 & id = $ 3?

[edit]

Yes Fixed.

I have to change the menu in header html in

shopon/shop/sales and it works

[/edit]

# For HTTPS pages:

RewriteCond% {HTTPS} off

RewriteRule ^ (\ checkout php |. Billing \ php |. Final \ php |. Admin / (*).) $ Https://% {HTTP_HOST} / $ 1 [R = 301, L]

 

</ IfModule>

Even with my ISP does not work.

I work at home with xampp in localhost and the ISP in a sub folder test.

Folder in localhost htdocs / shopon

Anyone have an idea?

Thanks and regards.

I'm running XAMPP on my pc and I foundout that the httpd.conf for Apache needs to be edited and have "AllowOverride none" changed to "AllowOverride All" for the mod_rewrite to work. Then test to see if your .htaccess is working. To do that add something like RewriteRule ^test.php index.php in the .htaccess file.

Link to comment
Share on other sites

 Share

×
×
  • Create New...