| | |
.htaccess exclude subfolders from urls
Please support our Site Layout and Usability advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
ok i have been working on this for 2 days now here is what im trying to do.
I have urls that look like this www.mysite.com/folder/folder/folder/file.php
What I would like the url to look like the url to look like is www.mysite.com/file.php
I know this can be done with .htacces i just cant figure out how.
If anyone knows how please share, thanks in advance.
I have urls that look like this www.mysite.com/folder/folder/folder/file.php
What I would like the url to look like the url to look like is www.mysite.com/file.php
I know this can be done with .htacces i just cant figure out how.
If anyone knows how please share, thanks in advance.
You will want rewrites to do this.
This will be fairly simple if the 'folder/folder/folder' is always the same, but if you have alot of sub directories then you will need more than just /file.php in the final URL
Take a look at http://www.sitepoint.com/article/guide-url-rewriting/
This will be fairly simple if the 'folder/folder/folder' is always the same, but if you have alot of sub directories then you will need more than just /file.php in the final URL
Take a look at http://www.sitepoint.com/article/guide-url-rewriting/
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
URL rewrites are good for translating set patterns, for example:
www.site.com/products.php?catagory=1&product=32&viewmode=2
to:
www.site.com/products/cat1/item32/2
But if you are using unknown folder structures or varying structures, then it will not be suitable unless you have numerous (and probably complex) rewrite rules.
Also, if you want all files to translate to site.com/file.php then you will need to make sure that every single file has a unique name.
ReWrites are best used for SEO, to the end user they make little difference.
www.site.com/products.php?catagory=1&product=32&viewmode=2
to:
www.site.com/products/cat1/item32/2
But if you are using unknown folder structures or varying structures, then it will not be suitable unless you have numerous (and probably complex) rewrite rules.
Also, if you want all files to translate to site.com/file.php then you will need to make sure that every single file has a unique name.
ReWrites are best used for SEO, to the end user they make little difference.
Last edited by Will Gresham; Sep 5th, 2009 at 8:20 pm.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Could I use something like this for multiple files?
Or This
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/free($|/)
RewriteRule ^.*$ /paid/index.html [L]Or This
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(folder1|folder2|folder3).*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./folder1/folder2/index.php [L] Last edited by valonesal; Sep 5th, 2009 at 8:40 pm.
Ok here is what I figured out, if I use
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/free($|/)
RewriteRule ^.*$ /paid/index.html [L]
and repeat the
RewriteCond %{REQUEST_URI} ^/free($|/)
RewriteRule ^.*$ /paid/index.html [L]
i can mask unlimited folders. If anyone has a better way please let me know.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/free($|/)
RewriteRule ^.*$ /paid/index.html [L]
and repeat the
RewriteCond %{REQUEST_URI} ^/free($|/)
RewriteRule ^.*$ /paid/index.html [L]
i can mask unlimited folders. If anyone has a better way please let me know.
![]() |
Other Threads in the Site Layout and Usability Forum
- Previous Thread: Flash-XML Menu
- Next Thread: Beginners Guide To Creating Database Driven Website
| Thread Tools | Search this Thread |
blogging content customer design development dreamweaver duplicate email evaluation filesharing firefox flash gilbane google html itunes javascript kazaa layout music napster peertopeer photoshop remote remoteserver satellitenavigation satnav server site tables template tips tomtom url wave web website websitedesignreview web_development web_sites





