Add trailing slash to end of URL

Discuss practical ways rearrange URLs using mod_rewrite.

Add trailing slash to end of URL

Postby starwing » Fri Aug 01, 2008 5:48 am

Hello,

Previously, I have

Code: Select all
RewriteEngine On
RewriteRule ^([a-z]+)/?$ ?page=$1 [L]


Previously it worked on another server, running Apache 2.2.4. I have migrated to a Apache 2.2.3 and it stoped working.

Basically, the rule is to add a trailing slash to the end of the URL. However, when I tried it on the 2.2.4 it gives an Error 404

In my directory, the file exist without /

In another words, I want it to look like it's a directory on the browser.
starwing
 
Posts: 2
Joined: Fri Aug 01, 2008 5:43 am

Postby richardk » Fri Aug 01, 2008 3:58 pm

Try this mod_rewrite test.

Try using the full path to "?page=$1"
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([a-z]+)/?$ /the/directory/?page=$1 [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby starwing » Sun Aug 03, 2008 4:35 am

hello,

I realized that it is not the problem with my mod_rewrite.

My Apache itself is not reading my files correctly, and I can't seem to be able to troubleshoot.

Thanks!
starwing
 
Posts: 2
Joined: Fri Aug 01, 2008 5:43 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 98 guests

cron