mydomain.com/rewrite_test/index.php
This page has a link on it that goes to
mydomain.com/rewrite_test/details/index.php?SEL=test1
Where SEL is an include file that is loaded out of
mydomain.com/rewrite_test/includes
I placed the .htaccess file in the /rewrite_test/ directory.
this file currently reads:
RewriteEngine on
RewriteBase /rewrite_test/
RewriteRule ^details/(.*)/(.*)/$ /index.php?$1=$2 [T=application/x-httpd-php,L]
This is like the tenth time I've rewritten the .htaccess file and nothing seems to be happening. I have server access and the module is properly loaded. (In my earliest attempts I did manage to get an internal server error message, so I know it works when I've got my syntax all screwed up) :)
I want to make the url look like
mydomain.com/rewrite_test/details/test1.php
How do I make this happen?
Did as you wrote. Recieved internal server error. Checked error log. Said this:
/.htaccess: RewriteBase takes one argument, the base URL of the per-directory
my .htaccess file reads like this:
RewriteEngine on
RewriteBase /rewrite_test/ /details/
RewriteRule ^(.*)details/(.*).php$ $1index.php?SEL=$2
I edited the .htaccess file to read like this:
RewriteEngine on
RewriteBase /rewrite_test/details/
RewriteRule ^(.*)details/(.*).php$ $1index.php?SEL=$2
Now I don't get the internal server error message, but it also doesn't do anything either.
RewriteEngine on
RewriteBase /rewrite_test/
RewriteRule (.*)details/(.*).php$ /index.php?SEL=$2 [T=application/x-httpd-php,L] Will take a url of
mydomain.com/rewrite_test/details/test1.php
and return the output from
mydomain.com/index.php?SEL=test1
(Hope theres no bugs - didn't test it)
[perl]
[mydomain...]
from requests for
[mydomain...]
in .htaccess
RewriteEngine on
RewriteBase /cgi-bin/forum/
RewriteRule (.*)/(.*)/(.*)/(.*)\.htm$ /cgi-bin/forum.cgi?$1=$2;$3=$4
[/perl]
Basically each of the $n variables gets the value of the corresponding bracketed section in your rule.
Don't put this on a live server without testing it first ;)
Gethan
to
RewriteRule (.*)/(.*)/(.*)/(.*)\.htm$ /cgi-bin/forum.cgi?$1=$2;$3=$4 [T=application/x-httpd-cgi]
did not make a difference :(
Let me thry to be more accurate.
http:www.mydomain.com/cgi-bin/forum.cgi?act=SF;f=1 will open a fourm topic.
I want to have a http:www.mydomain.com/cgi-bin/forum/act/SF/f/1.htm
or some similar format that is search engine frienly open the same file.
I am trying to work on getting an Ikonboard dbd based forum to be spider friendly.
Also from a spider point of view moving the location from cgi-bin is a good idea. Try out...
RewriteEngine on
RewriteBase /forum/
RewriteRule (.*)/(.*)/(.*)/(.*)\.htm$ /cgi-bin/forum.cgi?$1=$2;$3=$4 [T=application/x-httpd-cgi]
(Cheers Mark - the cgi bit should be there)
The above should work - but it is off the top of my head - eg. not tested.
Good luck.
is the following code sufficient for a complete .htaccess file or is there something else needed?
RewriteEngine on
RewriteBase /forum/
RewriteRule (.*)/(.*)/(.*)/(.*)\.htm$ /cgi-bin/forum.cgi?$1=$2;$3=$4 [T=application/x-httpd-cgi]
when the above code is saved in the website root directory as .htaccess, it intercepts all calls to www.domain.com. is that what it is intended to do?
the sooner i get my head around this stuff the happier i'll be.