Jump to content

Small .htaccess Mod Rewrite Help


.Darkman

Recommended Posts

Hello Everybody,

 

I'm using MediaWiki and using .htaccess to make URLs better.

 

Using this code :

RewriteRule ^(.+)$ /index.php?title=$1 [L,QSA]

This redirects http://mysite.com/Page to http://mysite.com/index.php?title=Page

 

I want to achieve this for subpages also.

(i.e) I want to redirect http://mysite.com/Page/Sub to http://mysite.com/index.php?title=Page/Sub

 

How do i do this ? I tried few codes. But, they didn't work. Please help me.

 

 

Thanks,

Link to comment
https://forums.phpfreaks.com/topic/73506-small-htaccess-mod-rewrite-help/
Share on other sites

They are conditions, they basically check if the requested filename is not an existing file/directory. If it is then the rewrite rules that follow will be ignored.

 

if you didn't add those lines in then Apache will always rewrite every url to index.php?title=request/file/path/here

 

You don't have to have those lines if you don't want them. But I have found they can be useful.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.