PaulMrG
PaulMrG

Reputation: 1822

Custom directory in Joomla when using search engine friendly URLs

I'm using the standard .htaccess file that comes with Joomla 2.5. Joomla is installed in the root directory and I'm using search engine friendly URLs.

Can I add something to the beginning of the .htaccess file that will check for my custom directory in the url and allow normal access without any url re-writing?

For example, if I wanted customdir/ as my directory with all of my custom pages and scripts I would link to something like http://mysite.com/customdir/customscript.php

Is this possible?

Upvotes: 0

Views: 50

Answers (1)

Felipe Alameda A
Felipe Alameda A

Reputation: 11799

You may try adding these lines in the standard Joomla .htaccess file, inside the 2 comment lines below:

## Begin - Custom redirects
RewriteCond %{REQUEST_URI} ^/customdir        [NC]
RewriteCond %{REQUEST_URI} !customscript\.php [NC]
RewriteRule .* /customdir/customscript.php    [L]
## End - Custom redirects

Maps silently:

http://mysite.com/customdir/ or

http://mysite.com/customdir/anything/

To:

http://mysite.com/customdir/customscript.php

For permanent and visible redirection, replace [L] with [R=301,L]

Upvotes: 1

Related Questions