11

Not being able to find your JavaScript and CSS files is a client-side/browser issue related to your URL-path, it's not something that should be fixed in .htaccess (at least not in this case) - although it is because you are changing this URL-path (in .htaccess) that you are experiencing this problem. This problem is caused by using relative URLs in your HTML....


9

All four of your URLs are different for SEO: http://www.example.com/product http://www.example.com/product/ http://www.example.com/product?source=googleps http://www.example.com/product/?source=googleps It doesn't matter which one of those four you use, but you have to pick one and use it consistently. Both slashes and parameters create new URLs to ...


6

Just redirect by 301 HTTP status all your old URLs to the new ones. If you only change file extension, you can do it easily with an .htaccess file (if you use Apache as a web server). Put these lines in your .htaccess file: RedirectMatch 301 (.*)\.html$ http://www.example.com$1.php Of course, change www.example.com by your domain name. By using 301 ...


5

I think the following would work: RewriteRule ^/index\.php/rss/rss1klik$ /index.php?option=com_obrss&task=feed&id=2:rss1klik&format=feed&Itemid=160 [L] But this may look better: RewriteRule ^/rss/rss1klik$ /index.php?option=com_obrss&task=feed&id=2:rss1klik&format=feed&Itemid=160 [L] Then the URL would be http://mydomain....


5

You are using the ^ and $ (anchors in regex speak) because you are matching the whole URL, which is what most people want to do, so this is the most common example you see. If you omit the ^ and/or $ anchors then you are only going to be matching part of the URL. eg. anything$ is going to match "anything" at the end of the URL - this could match too many ...


5

It generally makes little difference. A 301 redirect may cause a short term drop in ranking, but nothing to worry about. An internal rewrite keeps the same URLs. You just need to be careful that you don't end up with duplicate content on multiple URLs.


4

This is the type of “cool” URI scheme that I aim for on my own personal website. Personally, the reason that I started to do so (and probably many more web designer/developers too!) was after reading the article “Cool URIs don't change” – this document was written by the World Wide Web's founding father, Tim Berners-Lee. In Tim Berners-Lee's famous article, ...


4

The "hashbang" or "shebang" url syntax is an old hack designed to provide browser history to AJAX sites and to help Google index content that is loaded via JavaScript. See "What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for?" for more. Your WordPress theme, "John Smith", is responsible for rewriting URLs in this way. It does this so that ...


4

The pseudo-code translation of your .htaccess file would be something along these lines: Line 1: In case we weren't previously planning to do anything special with URLs, we are now (RewriteEngine is an optional processing module and we're making sure its enabled). Line 2: When we're talking about rewrite URLs, from here on append the path / to the beginning ...


4

You can use one of these solutions: Keep the Current .html extension unchanged for just frontend purpose and use Apache .htaccess file to proxify your requests so that. Add this to your .htaccess file to work: RewriteEngine on RewriteRule ^(.*).html $1.php OR Why not just have the HTML pages parsed as PHP? That way you can get the best of both php ...


4

You need to set an alias. location /coolapp/ { alias /var/www/apps/coolapp/; } Read more nginx Update after comment: Unfortunately, it's not working for me. I'm getting a 404 response when trying to request www.mysite.com/coolapp/test.php when /var/www/apps/coolapp/test.php exists To understand why alias is not working, you have to take a ...


4

Search engines see both dashes and slashes as word separators, so they will be able to parse either of your URLs. Traditionally slashes in URL paths represent directory structures. Because of this, some users may expect that if you use /blue/suede-shoes/ they should be able to find a page at /blue/ with information about all your blue products. I would ...


4

The software 'WebsitePanel' does not allow you to make subdomains of a subdomain. You could use a sub-domain to create a new web site, but you cannot create another sub-domain based on it. From http://www.websitepanel.net/documentation/users-guide/domains/#ManagingSub-Domains


4

Note that if you need to match against the query string, you need to compare against the QUERY_STRING server variable in a mod_rewrite RewriteCond directive. You can't match against the query string using a mod_alias Redirect (or RedirectMatch) or the RewriteRule (mod_rewrite) pattern - these all match against the URL-path only, which notably excludes the ...


4

Apache server can be configured to show the error page at the error URL, or it can redirect to the error page. It is almost better to show the error page directly at the URL rather than redirecting to it. The Apache ErrorDocument directive explains how to implement it both ways: URLs can begin with a slash (/) for local web-paths (relative to the ...


4

I assume you want to remove the trailing slash (if any) with an external redirect in order to canonicalise the URL and then append the .php extension with an internal rewrite (ie. hidden from the user) in order to correctly route the URL. This is a two-stage process. NB: The trailing slash should remain if accessing a physical directory. Using mod_rewrite ...


4

tl;dr Yes, you can enable MultiViews to serve extensionless URLs. ie. Where the file extension is omitted from a URL that would otherwise map to an existing file. However, be aware of potential conflicts with mod_rewrite. the server won't even open links to the site that are missing a file extension You make it sound that this should be normal (or ...


4

If the underlying filename is script.js.php then it doesn't make sense to rewrite this to script.js - as that would result in a 404. However, the directives you posted would seem to result in a 404 for a different reason, as they rewrite script.js.php to script.js.php.js. Presumably, you want to link to script.js?c=21 and internally rewrite this to script....


4

Yes, you have a conflict. Both your .htaccess rules have exactly the same conditions, so the first one is always going to win. The second is never going to be executed. Your URL structure is ambiguous. You need to take a step back, before trying to write any code, how would you resolve the following URLs: https://example.com/home https://example.com/...


4

If you correctly put in 301 redirects and update your sitemap, the site will be fine. However... What are you trying to gain from this change? The Stack Exchange-style hierarchy doesn't make sense for what it seems you're trying to accomplish (a Wikipedia-style website?). What you currently have makes more sense in terms of organizing the information: ...


3

As addition to above answers one can use RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^([\w-]+)$ $1.html [L] ([\w-]+) Allows letters, digits with a hyphen (-). (.*) will rewrite every request regardless, which may impotent other following rules causing internal server error on accessing.


3

This works perfect for what I'm trying to do, I have some PHP based admintools in respective directories under /admin/, in /admin/.htaccess I have listed: SSLOptions +StrictRequire SSLRequireSSL SSLRequire %{HTTP_HOST} eq "www.example.com" ErrorDocument 403 https://www.example.com/admin/ AuthName "Enter your credentials" AuthType Basic AuthUserFile /etc/...


3

You need to enable the rewrite engine in your .htaccess file if you have not done already... RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] Note that I've removed the extra .com on the RewriteCond line that you have in your question - I'm assuming this was a typo? Also, FollowSymLinks ...


3

You have RewriteEngine On missing RewriteCond are only applicable to next immediate RewriteRule Try this code: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^explore/(.*)$ index.php?page=explore&type=$1 [L] RewriteCond %{REQUEST_FILENAME} !-l ...


3

Rather than build pages around currencies, build pages for users from different countries. See: How should I structure my URLs for both SEO and localization? Google allows sites with substantially the same content if they are targeted at users from different countries. The targeted country should be part of the host name or folder structure, not a URL ...


3

I needed a PT flag instead of [NC, L] in order to pass the result URL to WSGIScriptAlias: RewriteEngine On RewriteRule ^/api$ /metadata [PT] Quoting the manual: The target (or substitution string) in a RewriteRule is assumed to be a file path, by default. The use of the [PT] flag causes it to be treated as a URI instead. That is to say, the ...


3

The problem you're having is solved with CORS: The Cross-Origin Resource Sharing standard works by adding new HTTP headers that allow servers to describe the set of origins that are permitted to read that information using a web browser. Additionally, for HTTP request methods that can cause side-effects on user data (in particular, for HTTP ...


3

Since the rule is only rewriting the URL, it should return a standard '200' HTTP header code (assuming there are no other errors). If you had used a redirect action type instead of rewrite, then you would have received a 301 or 302 HTTP response code depending on how the rule was configured. There are a variety of tools available that you can install on ...


3

If all you are doing is moving the files on your file system to another location but want to keep the same URL structure, rather than setting up URL Rewrite rules you can change the physical path of your IIS website configuration. I will make the following assumptions: You are running website "mydomain.edu" from a physical location such as C:\inetpub\...


3

My thoughts are further into the future, the less priority the page has? In your particular case I think this is a fair determination. Just keep in mind that the priority flag doesn't really seem to do much so don't expect to see anything change as a result of this change. Am I structuring my URLs in an effective manner, our would I be better passing the ...


Only top voted, non community-wiki answers of a minimum length are eligible