Jump to content

RewriteRule to fit all of my URLs


wright67uk

Recommended Posts

I have about 100 pages, which are all in the same format as the three URLs in my .htaccess file as below

eg. COURIER\.php?subtype=COURIER

instead of making 100 RewriteRules is it possible to make one RewriteRule that all of my URLs can use?

 

<Files ~ "^\.(htaccess|htpasswd)$">

allow from all

</Files>

 

AddHandler x-httpd-php5 .php

AddHandler x-httpd-php .php4

 

Options +Indexes +FollowSymlinks -MultiViews

 

RewriteEngine on

RewriteBase /

 

RewriteCond %{HTTP_HOST} ^(mysite\.co\.uk)(:80)? [NC]

RewriteRule ^(.*) http://www.mysite.co.uk/$1 [R=301]

 

RewriteRule ^courier\.*$ COURIER\.php?subtype=COURIER [NC,L,N]

RewriteRule ^valeting\.*$ VALETING\.php?subtype=VALETING [NC,L,N]

RewriteRule ^sales\.*$ SALES\.php?subtype=SALES [NC,L,N]

 

order deny,allow

Link to comment
https://forums.phpfreaks.com/topic/245238-rewriterule-to-fit-all-of-my-urls/
Share on other sites

Some of them are    :-\

 

To be honest with you I used to host on Windows server, and didnt really thing a great deal about the case of my file names, then I discovered that linux was a better option for dynamic sites

 

I've used nc in my flags but id like to learn how to make a rule that will effect all of my urls

 

 

 

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.