How can I create urls without any extension? I want neither html or php. I tried leaving the field empty in settings, but that definitely didn't work.
I need to do this for creating landing pages in an ad campaign, so it's pretty important.
thanks!
How can I create urls without any extension? I want neither html or php. I tried leaving the field empty in settings, but that definitely didn't work.
I need to do this for creating landing pages in an ad campaign, so it's pretty important.
thanks!
It works for me though …Originally Posted by billhector
nope. double checked my work. purged data (don't know if that would make a difference). I can't get this to work. Tried putting a slash in there too (to close the url) and still didn't get it to work.
Here is my htacess file:
just standard stuff, no changes.Code:## # Rewrite base ## RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] ## # Block malicious requests ## RewriteCond %{REQUEST_URI} (ftp|https?):|/etc/ [NC,OR] RewriteCond %{QUERY_STRING} (ftp|https?):|/etc/ [NC] RewriteRule .* - [F,L] ## # Compress .js and .css files ## AddEncoding gzip .gz <FilesMatch "\.js\.gz$"> AddType "text/javascript" .gz </FilesMatch> <FilesMatch "\.css\.gz$"> AddType "text/css" .gz </FilesMatch> RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{REQUEST_FILENAME} \.(js|css)$ RewriteCond %{REQUEST_FILENAME}.gz -f RewriteRule ^(.*)$ $1.gz [QSA,L] ## # Rewrite TYPOlight URLs ## RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .*\.html$ index.php [L]
any ideas? thanks for the help!
That is exactly the problem. The default routine only rewrites .html files.Originally Posted by billhector
in case anybody is wondering how to do it, if you want to remove all extensions from your urls (and close the url with / ), first go to your settings and remove the default .html with /
Then go to your htaccess file and find this line:
and replace it with this:Code:RewriteRule .*\.html$ index.php [L]
That's it! you're good to go.Code:RewriteRule . /index.php [L]
Why would you want to do this? Well, in my case I am doing advertising and creating landing pages, thus extensions complicate the user experience. Of course, there are other reasons.
I think it should be
Code:RewriteRule .* index.php [L]
Could you tell me about the other benefits and possible drawbacks? There is a lot to be found on SEO and of course what is best for users, it is hard though to figure out which method is actually best. But I'd switch .html for / if that really is better for a good reason.
The only thing (seo) that I can think of is that directory names are more important then filenames for search engines.
The only user experience advantage that I can think of is that no file extension means no typos (htm vs html)
Humm ... either mine or yours seems to work with no error messages.Originally Posted by leo
Actually, for me SEO is not a reason to do this. That may or may not help. 95% of what you hear about SEO is crap. Did you know that last week the google announced they were no longer considering "page rank" in search result order?Originally Posted by Vera
As I said previously, I need these shorter urls for creating landing pages and ad campaigns. So, for example, there is a holiday sale that I want to do an ad campaign for and we have a landing page just for that sale. For SEO purposes the page is called '/2009-holiday-sale-on-widgets.html'. that's way too much when dealing with buying ads through google, so I just create a new redirect page that redirects to the one with the longer url and name it /holiday-sale/
Again, what I am dealing with is for specific situation. your mileage may vary.
Thanks for the ".html removal" tips here, Bill and Leo.
By the way, the only people I've ever met that say "wicked [something]" are from Connecticut and Massachusetts. Fred - I know you're guilty of this one too. :D
This is very helpful, thanks everyone.
Now if there were only an easier way to echo the page structure (like domain.com/people/mark/)... I haven't had any luck with the folderurl extension!
Bookmarks